package indi.cyh.fastservice.base.entity.http;

import lombok.Data;

/**
 * @Description TODO
 * @Author CYH
 * @Date 2021/7/20 18:28
 **/
@Data
public class ResponseBase {

    public static final String ok = "0";
    public static final String failed = "-1";

    private String status = ok;
    private String message = "";
    private Object result = null;

    public static ResponseBase success(Object result) {
        ResponseBase responseBase = new ResponseBase();
        responseBase.setStatus(ok);
        responseBase.setResult(result);
        return responseBase;
    }

    public static ResponseBase fail(String message) {
        ResponseBase responseBase = new ResponseBase();
        responseBase.setStatus(failed);
        responseBase.setMessage(message);
        return responseBase;
    }


}
